// 登录接口
export const login = (data) => {
	return uni.$uv.http.post(
		'/user/user/login', // 修正路径
		new URLSearchParams(data).toString(), // 转为表单格式
		{
			header: {
				'Content-Type': 'application/x-www-form-urlencoded'
			},
			custom: {
				loading: true,
				toast: true
			}
		}
	);
};

// 记录当前用户id
export const setToken = (token) => {
	return uni.$uv.http.post(
		'/elderly/user/token',
		new URLSearchParams({
			token
		}).toString(), {
			header: {
				'Content-Type': 'application/x-www-form-urlencoded'
			},
			custom: {
				loading: false,
				toast: false
			}
		}
	);
};